﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {
            //            1、音乐老师（既是老师，又是运动员），需要有一种结构，音乐老师继承老师，同时继承运动员。
            //            程序员（既是员工，又是作家），需要有一种结构，程序员继承员工，同时继承作家。
            Teacher teacher = new Teacher("张三");
            teacher.teacher();
            music(teacher);
            swim(teacher);

            Programmer programmer = new Programmer("李四");
            programmer.programmer();
            staff(programmer);
            writer(programmer);

        }
        public static void music(Teacher teacher) 
        {
            Iteacher iteacher = teacher;
            iteacher.music();
        }

        public static void swim(Teacher teacher)
        {
            ISwimming swim = teacher;
            swim.Athletes();
        }
        public static void staff(Programmer programmer)
        {
            Istaff istaff = programmer;
            istaff.staff();
        }

        public static void writer(Programmer programmer)
        {
            Iwriter iwriter = programmer;
            iwriter.writer();
        }
    }
}
